package com.nescafe.nescafepromo.command;

public enum CommandType {

	/**
	 * 
	 * ADMIN COMMANDS
	 * 
	 */

	ADD_PURCAHSE(true, new String[]{"receipt_no","receipt_time","branch","email","amount"}),//same page from search purchases
	SEARCH_PURCHASES(true, new String[]{"from","to","branch","email"}), 
	SEARCH_PARTICIPANTS(true, new String[]{"email"}),//summary with total points
	SEARCH_PAYPAL_PURCHASES(true,new String[]{}),
	SEARCH_EXTRA_POINTS(true,new String[]{"from","to","email"}),// points from shout out
	DRAW_WINNERS(true, new String[]{"drawcount"}),
	

	/**
	 * 
	 * USER COMMANDS
	 * 
	 */

	SHOUT_OUT(true,new String[]{"email","access_token","fb_id"}),
	VIEW_HISTORY(true,new String[]{}),
	//GET_MAIN_PAGE_INFO(true,new String[]{"fb_id","email","name","location"}),
	GET_MAIN_PAGE_INFO(true,new String[]{}),
	 

	/**
	 * 
	 * COMMON COMMANDS
	 * 
	 */

	GET_PARTICIPANT_DETAILS(true, new String[]{})

	;

	private boolean secured = false;
	private String[] requiredParams = null;

	public boolean isSecured() {
		return secured;
	}

	public String[] getRequiredParams() {
		return requiredParams;
	}

	private CommandType(boolean secured, String[] requiredParams) {
		this.secured = secured;
		this.requiredParams = requiredParams;
	}

	public static CommandType parse(String value) {
		return CommandType.valueOf(value.toUpperCase());
	}

}
